<!--219970838杨彪-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>函数的应用</title>
	</head>
	<script>
		"use strict";
		getsum(4,6);
		function getsum(num1,num2)
		{
			var sum = num1 + num2;
			console.log(num1+"+"+num2+"="+(num1+num2));
		}
		
		var getProduct = function (num1, num2) 
		{
		   console.log(num1+"*"+num2+"="+(num1*num2));
		}
		getProduct(2,4);
		var a= 100;
		function test() 
		{
			console.log(a);
			a = 10;
			console.log(a) ;
		}
		test();
		console.log(a);
		var a= 10;
		fun1();
		function fun1()
		{
		   var b= 20;
		   console.log(a);
		   console.log(b);
		   var a = 30;
		}
		function fun2(a, b) 
		{
		   console.log(arguments[0]);
		   console.log(arguments[1]);
			console.log(arguments[2]);
		}
		fun2(1,2,3);
		try{
			 num= 100;
		}
		 //严格模式下必须定义类型
		catch
		{
			console.log("这里有错");
		}
		
	</script>
	<body>
	</body>
</html>
